#ifndef _BUOLA_MEDIA_AUDIO_BPULSESINK_H_
#define _BUOLA_MEDIA_AUDIO_BPULSESINK_H_

#include <buola/config.h>

#ifndef BUOLA_HAVE_PULSE
    #error "pulseaudio not supported in this build of buola"
#endif

#include <buola/bbox/bservice.h>
#include <buola/bbox/bstreamin.h>

namespace buola { namespace media {

class BPulseSink : public bbox::BService<BPulseSink>
{
    struct SImpl;

public:
    BPulseSink();
    ~BPulseSink();

    void PushedBufferCB(const CBuffer<int16_t> &pBuffer);

private:
    double mVolume;
    bool mMute;

#if 0
    static void Introspect()
    {
        introspector.AddProperty<double>("volume",&GetVolume,&SetVolume);
    }
#endif

public:
    bbox::BStreamIn<int16_t> iWave;

private:
    std::unique_ptr<SImpl> mP;
};

/*namespace media*/ } /*namespace buola*/ }

#endif

